import https, { GetRequest } from "@request/https"
import {PostJson} from "@/request/https";
const BASE_URL_API = process.env.VUE_APP_BASE_URL
const BASE_URL_DBAPI = process.env.VUE_APP_OTHER_URL
const BASE_URL_LJXQ = process.env.VUE_APP_LJXQ_URL
const BASE_URL_YPSD = process.env.VUE_APP_YPSD_URL


class CommonDB {
  static getJianKongLieBiao (data) {
    return GetRequest(`${BASE_URL_API}/screen/constSite/getViDeviceList`, data)
  }

  static getOaOrderGetInfo (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getInfo`, data)
  }
}

class YangChenJianCeDB {
  static DianWeiTongJi () {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getNum`)
  }

  static BaoJingTongJi () {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getReportPolice`)
  }

  static YichangTongJi () {
    return GetRequest(`${BASE_URL_LJXQ}/screen/guns/getUnusualMonitorPoint`)
  }
  static JiebanPaimingTongJi (data) {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getStreetRank`, data)
  }

  static DianweiPaimingTongJi (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/guns/getPointRank`, data)
  }

  static dianweiList (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/guns/getPointAqiGps`, data)
  }

  static getPointIndexNum (data) {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getPointIndexNum`, data)
  }

  static getPointMonitoring (data) {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getPointMonitoringWarning`, data)
  }

  static getPointStandardTrend (data) {
    return GetRequest(`${BASE_URL_DBAPI}/raiseDust/getPointStandardTrend`, data)
  }
}

class ZhiHuiGongDiDB {
  static getShuJuTongJi () {
    return GetRequest(`${BASE_URL_DBAPI}/construction/getNum`)
  }
  static getZuiXinAnJian () {
    return GetRequest(`${BASE_URL_DBAPI}/construction/getNewOrder`)
  }

  static getCaiJiLiang () {
    return GetRequest(`${BASE_URL_DBAPI}/construction/getDayStreetOrder?type=3`)
  }

  static getNewOrder () {
    return GetRequest(`${BASE_URL_DBAPI}/construction/getNewOrder`)
  }
}

class ZhanDaoJingYing {
  static CaijiTongji () {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/roadsideTotal`)
  }

  static GetDayOrderNum () {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/getDayOrderNum`)
  }

  static GetNewList () {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/newList`)
  }

  static GetStreet (data) {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/street`, data)
  }

  static GetTypeCount (data) {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/getTypeCount`, data)
  }

  static GetOredrList (data) {
    return GetRequest(`${BASE_URL_DBAPI}/roadside/oredrList`, data)
  }
  // 抓拍返回图片
  static zhuaPaiUrl (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/insertWorksite`, data)
  }
  // 抓拍信息确认
  static zhuaPaiConfirm (data) {
    return PostJson(`${BASE_URL_LJXQ}/screen/fansbase/gather`, data)
  }
}

class LaoJiuXiaoQuDB {
  static getTonjiShuJu () {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oldCommunity/commGatherResult`)
  }

  static getZuiXinAnJian () {
    return GetRequest(`${BASE_URL_DBAPI}/oldCommunity/latestCases`)
  }

  static getPercentage (data) {
    return GetRequest(`${BASE_URL_DBAPI}/oldCommunity/street/Percentage`, data)
  }

  static getRankingList (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oldCommunity/getRankingList`, data)
  }

  static getCommunityList () {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oldCommunity/getCommunityList`)
  }

  static getCommunityInfo (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oldCommunity/getCommunityInfo`, data)
  }
}

class MenTouBaoShenDB {
  static getTonjiShuJu () {
    return GetRequest(`${BASE_URL_DBAPI}/cc/getStoreStateNum`)
  }

  static getShenHe () {
    return GetRequest(`${BASE_URL_DBAPI}/cc/getStoreAudit?dayNum=5`)
  }

  static getZhengGai () {
    return GetRequest(`${BASE_URL_DBAPI}/cc/StoreRectifyRank`)
  }

  static getNewStore () {
    return GetRequest(`${BASE_URL_DBAPI}/cc/getNewStore`)
  }

  static getGpsList () {
    return GetRequest(`${BASE_URL_DBAPI}/cc/getGpsList`)
  }
  
  static getStoreId (data) {
    return GetRequest(`${BASE_URL_DBAPI}/cc/getStoreId`,data)
  }
}

class HomeDb {
  // 本月街乡案件承办情况
  static getHomeStreetOrder (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getHomeStreetOrder`, data)  // 本月案件数量（街乡
  }

  // 受理案件统计
  static getCaseStatistics (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/caseStatistics`, data)  // 受理案件统计
  }

  // 案件类型占比
  static getTypeProportion (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/typeProportion`, data)  // 案件类型占比
  }

  // 查询最新案件
  static getNewOrder (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/getNewOrder`, data)  // 查询最新案件
  }

  // 本月案件数量
  static getOrderNumStreet (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/getOrderNumStreet`, data)  // 本月案件数量（街乡
  }

  // 本月案件办理考核top
  static getExamineTop (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/examineTop`, data)  // 受理案件统计
  }

  // 案件类型承办top榜单
  static grtCaseRanking (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/caseRanking`, data)  // 案件类型承办top榜单
  }

   // 首页地图点位
   static getDianweiList (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/orderList`, data)  // 案件类型承办top榜单
  }

  // 点位地图  (智慧街乡-地图点位同样接口)
  static getHomeDianwei (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/mapList`, data)  // 案件类型承办top榜单
  }

  // 新增点位地图
  static getHomeMapList (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/getMapList`, data)  // 案件类型承办top榜单
  }

  // 修改点位地图
  static getUpdateOrderState (data) {
    return GetRequest(`${BASE_URL_DBAPI}/home/getUpdateOrderState`, data)  // 案件类型承办top榜单
  }

  // 修改点位地图
  static getStatisticsOrderNum (data) {
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getStatisticsOrderNum`, data)  // 案件类型承办top榜单
  }

  static getOaMenuConfig (data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/oaMenuConfig/get`, data)  // 案件类型承办top榜单
  }
}
class YingPanShiDian {
  //查询基础数据
  static getCampPilot (data){
    return GetRequest(`${BASE_URL_YPSD}/screen/campPilot/get`,data)
  }

  // 查询案件类型占比
  static getOrderType (data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/campPilot/getOrderType`,data)
  }

  // 查询近一周案件数
  static getNearlyWeekOrder (data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/campPilot/getNearlyWeekOrder`,data)
  }

  // 查询近一周巡查情况
  static getNearlyWeekPatrol (data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/campPilot/getNearlyWeekPatrol`,data)
  }

  //查询所有街办
  static gridDataSelectStreet (data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/gridData/selectStreet`, data)
  }

  //根据街办查询
  static gridDataSelectByStreet(data) {
    return GetRequest(`${BASE_URL_YPSD}/screen/gridData/selectByStreet`, data)
  }
    
}

class WelCome {
  static oaMenugetAll (data){
    return GetRequest(`${BASE_URL_LJXQ}/screen/oaMenu/getAll`,data)
  }
  static oaMenuChildgetByMenuId (data){
    return GetRequest(`${BASE_URL_DBAPI}/screen/oaMenuChild/getByMenuId`,data)
  }
}

class BuJianMapDB {
  static getFuMenuAtype (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getFuMenuAtype`,data)
  }
  static getFuMenuBtype (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getFuMenuBtype`,data)
  }
  static getMenuOrderNum (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getMenuOrderNum`,data)
  }
  static getBaseOrderNum (data){
    return GetRequest(`${BASE_URL_LJXQ}/screen/fuMenu/getBaseOrderNum`,data)
  }
  static getNewOrderList (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getNewOrderList`, data)
  }
  static getStreetBaseOrderNum (data){
    return GetRequest(`${BASE_URL_LJXQ}/screen/fuMenu/getStreetBaseOrderNum`, data)
  }
  static baseGetGps (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getGps`, data)
  }
  static getGpsInfoOrder (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getGpsInfoOrder`, data)
  }
  static getGpsInfo (data){
    return GetRequest(`${BASE_URL_DBAPI}/base/getGpsInfo`, data)
  }
}

class ShiChangJianDuDB {
  static getKeyAreas (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getKeyAreas`, data)
  }
}
// 街乡吹哨
class JieXiangChuiShaoDB {
  static getOaStreetWhistleOrdert (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getNum`,data)
  }
  static getOaStreetWhistleOrdertSatisfactionLeve (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getSatisfactionLevel`,data)
  }
  static getOaStreetWhistleOrdertNewStreetOrder (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getNewStreetOrder`,data)
  }
  // 街乡吹哨案件统计
  static getOaStreetWhistleOrdertStreetOrderNum (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getStreetOrderNum`,data)
  }
  // 街乡吹哨案件类型统计
  static getOaStreetWhistleOrdertStreetOrderType (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getStreetOrderType`,data)
  }
  // 部门办哨案件统计
  static getOaStreetWhistleOrdertOrgOrderNum (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getOrgOrderNum`,data)
  }
  static getOaStreetWhistleOrdertGpsStreetOrder (data){
    return GetRequest(`${BASE_URL_LJXQ}/oaStreetWhistleOrder/getGpsStreetOrder`,data)
  }
}
export { CommonDB, YangChenJianCeDB, ZhiHuiGongDiDB, ZhanDaoJingYing, LaoJiuXiaoQuDB, MenTouBaoShenDB, HomeDb, YingPanShiDian, WelCome, BuJianMapDB, ShiChangJianDuDB, JieXiangChuiShaoDB}


// 街办列表
export function getViDeviceStreet (data) {
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getViDeviceStreet`, data)
}
// 部件地图 -- 街道列表
export function queryBjMapStreetList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/gridDataSub/listStreet`, data)
}
// 部件地图 -- 社区列表
export function queryBjMapCommunityList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}//screen/gridDataSub/listCommunity`, data)
}
// 部件类别列表
export function queryBujianTypeList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/fuBase/listAllData`, data)
}
// 部件地图列表 -- 标记 + 详情
export function queryBuJianPointList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/fuBaseInfo/getDetails`, data)
}
// 部件地图列表 --网格
export function queryBuJianAreaGridList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/gridDataSub/listTitle`, data)
}
// 部件地图列表 -- 点位
export function queryBuJianAreaList (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/gridDataSub/listGripSub`, data)
}

// 部件地图详情中--案件发生频率
export function queryAcquireComponentCases (data) {
  return https.GetRequest(`${BASE_URL_YPSD}/screen/fansbase/getAcquireComponentCases`, data)
}

//监控列表
export function getViDeviceList (data) {
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getViDeviceListScreen`, data)
}


//视频抓拍
export function videoTakePhoto (data) {
  return https.GetRequest(`${BASE_URL_API}/video/takePhoto`, data)
}
//生成工单
export function videoOrderAdd (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/dust/takePIC`, data)
}
//所有类型
export function fansTypeListAll (data) {
  return https.GetRequest(`${BASE_URL_API}/fans/type/listAll`, data)
}

//查询PM25 OR PM10 OR 噪音
export function getDataRank (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/constSite/getDataRank`, data)
}

//进十天抓拍数量
export function getSnapwTop10Day (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/constSite/getSnapwTop10Day`, data)
}

//查询报警信息
export function getAlarmInformationListScreen (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/constSite/getAlarmInformationListScreen`, data)
}

//查询监控数量OR抓拍数量
export function getDeviceNumScreen (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/constSite/getDeviceNumScreen`, data)
}

//占比数据
export function getProportionDataScreen (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/jeeves/getProportionDataScreen`, data)
}

//违规排行
export function getViolationsRankScreen (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/jeeves/getViolationsRankScreen`, data)
}

//违规事件
export function getViolationsScreen (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/jeeves/getViolationsScreen`, data)
}

//数据排行
export function getCallPoliceNumList (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/dust/getCallPoliceNumList`, data)
}

//查询扬尘地图点位
export function getSiteLonLatList (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/dust/getSiteLonLatList`, data)
}

//查询扬尘位详情
export function getAirmonitorId (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/dust/getAirmonitorId`, data)
}

//扬尘监测-7天内处理事件
export function getHandlingEventsList (data) {
  return https.GetRequest(`${BASE_URL_API}/screen/dust/getHandlingEventsList`, data)
}

//智慧街乡-获取当前街道数据
export const getDangQianJieDaoList = () => { 
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/fontOrg/getStreet`)
}
//智慧街乡-最新案件
export const getZuiXinAnJianList = (Id) => { 
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getLatest`,Id)
}
//智慧街乡-年度排行
export const getNianDuPaiHangList = (Id) => { 
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getThisYearTop`,Id)
}
//智慧街乡-数据统计
export const getStatisticsLists = (Id) => { 
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/get`,Id)
}

export const getScreenStreetDataAPI = (Id) => { 
  return https.GetRequest(`${BASE_URL_LJXQ}/screen/oaOrder/getScreenStreetData`,Id)
}


// 市场监督
class MarketSurveillanceDB {
  static getNum (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getNum`,data)
  }
  static getCommunityOrderNum (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getCommunityOrderNum`,data)
  }
  static getTypeNum (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getTypeNum`,data)
  }
  static getOrderStateNum (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getOrderStateNum`,data)
  }
  static getOrderList (data){
    return GetRequest(`${BASE_URL_DBAPI}/wuc/getOrderList`, data)
  }
  
}

export { MarketSurveillanceDB }